OsCommerce HTTP Error Handling add-on (v2.3)
Copyright (c) 2004 osCommerce
  by hobbzilla (Ryan Hobbs)
  email: hobbzilla@hobbzilla.com
  url  : http://www.hobbzilla.com
-------------------------------------------------
Download: http://www.oscommerce.com/community/contributions,933

Description:
------------
This will make any of those ugly 404 error pages disappear and be replaced 
with a simple error surrounded by your sexy oscommerce shop and the Advanced Search feature. Thus not leaving 
a potential customer stranded with no place to go!

It is offered only in English. But is language modular in its design.


================= IMPORTANT =====================
FILES INCLUDED IN PACKAGE:
/catalog/http_error.php
/catalog/includes/languages/english/http_error.php
/catalog/includes/languages/french/http_error.php

FILES YOU HAVE TO PERFORM SOMETHING ON:
http_error.sql
/catalog/includes/languages/ANY_OTHER_LANG/http_error.php
/catalog/includes/filenames.php
.htaccess <--Apache httpd server only (see Installation instructions)
=================================================


Installation instructions.
--------------------------
Make a folder in catalog named log to have: catalog\log folder and give it the right permissions
for PHP to write to it.

Add to /catalog/includes/filenames.php

define('FILENAME_HTTP_ERROR', 'http_error.php'); // Custom HTTP Error Page 

Unpack the zip file to a temporary directory. All of the files are stored in 
the same directory structure as a default osc installation (e.g. catalog and 
admin). For those of you with Apache create/edit your .htaccess file in your 
ROOT directory (not /catalog/) to contain the following:

ErrorDocument 400 /catalog/http_error.php?error_id=400
ErrorDocument 401 /catalog/http_error.php?error_id=401
ErrorDocument 403 /catalog/http_error.php?error_id=403
ErrorDocument 404 /catalog/http_error.php?error_id=404
ErrorDocument 405 /catalog/http_error.php?error_id=405
ErrorDocument 408 /catalog/http_error.php?error_id=408
ErrorDocument 415 /catalog/http_error.php?error_id=415
ErrorDocument 500 /catalog/http_error.php?error_id=500
ErrorDocument 501 /catalog/http_error.php?error_id=501
ErrorDocument 502 /catalog/http_error.php?error_id=502
ErrorDocument 503 /catalog/http_error.php?error_id=503
ErrorDocument 505 /catalog/http_error.php?error_id=505
ErrorDocument 504 /catalog/http_error.php?error_id=504
#NOTE: if you've installed the catalog in a different directory, change /catalog/ above.

Be warned that some Linux servers (like SMEServer) disable the use of .htaccess files as a means
of increasing security. For such servers you will need to edit the /etc/httpd/conf/httpd.conf
file to include the error document settings as shown below:

<Directory /full/path/to/location/of/web/site/base>
    ErrorDocument 400 /http_error.php?error_id=400
    ErrorDocument 401 /http_error.php?error_id=401
    ErrorDocument 403 /http_error.php?error_id=403
    ErrorDocument 404 /http_error.php?error_id=404
    ErrorDocument 405 /http_error.php?error_id=405
    ErrorDocument 408 /http_error.php?error_id=408
    ErrorDocument 415 /http_error.php?error_id=415
    ErrorDocument 416 /http_error.php?error_id=416
    ErrorDocument 417 /http_error.php?error_id=417
    ErrorDocument 500 /http_error.php?error_id=500
    ErrorDocument 501 /http_error.php?error_id=501
    ErrorDocument 502 /http_error.php?error_id=502
    ErrorDocument 503 /http_error.php?error_id=503
    ErrorDocument 504 /http_error.php?error_id=504
    ErrorDocument 505 /http_error.php?error_id=505
</Directory>

Of course you will need to change the path listed in the Directory statement to the correct
location for your web site. If the http_error.php catalog file is not in the base location
for your web site (i.e. where the user goes if all they enter is www.yourwebsitename.com)
you will need to include the path to the http_error.php file as shown in the example
for use with htaccess.

For other webservers (IIS,etc.), see your documentation on how to change paths 
for error documents that are site specific.

The files can be moved to their respective directories, there should be no 
need.. but standard disclaimer: BACK UP your files.

In the temporary http_error directory you will find an .sql file. This 
contains the mysql configuration data for having the ability to set log/e-mail 
options in the admin. This step is not required if you do not want this functionality
You can simply edit (/catalog/http_error.php) and set those options manually if desired.
You should add these definitions to your shop database by whatever means 
you are most comfortable with (e.g phpmyadmin, telnet).  Once added you will need to
visit:
Admin->Configuration->Logging
Admin->Configuration->E-mail Options


*** IMPORTANT ***
Please remember to include a copy of the language http_error.php into each installed 
language for the site, otherwise you will get errors when another language is being 
used. i.e. /catalog/includes/languages/LANG/http_error.php

You can simply copy the .../english/http_error.php to .../LANG/http_error.php but 
then all errors will be output in english. You can use babelfish if you trust it.

Disclaimer
----------
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
(LICENSE) along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Author
----------
Please feel to contact me via hobbzilla@hobbzilla.com
osC contribution forum: http://forums.oscommerce.com/index.php?showtopic=178259

osC forum username: hobbzilla

I don't expect anyone ever to give me any money for this. But if you find this 
useful, send me 50 to buy a coke! Paypal e-mail address: hobbzilla@hobbzilla.com